home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / doFilletBlendArgList.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.4 KB  |  112 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  July 24, 1998
  22. //  Author:        ms
  23. //
  24. //  Description:
  25. //      The doFilletBlendArgList() procedure executes one fillet blend
  26. //       operation on the selected objects.
  27. //
  28.  
  29.  
  30. proc string pieceTogetherBlendCmd( string $version, string $args[] )
  31. //
  32. //    Description :
  33. //        Put together an blend Cmd.  Note that there is enough curves by now.
  34. //
  35. {
  36.     string $cmd = "";
  37.     int $need = 9;
  38.     if( "1" == $version ) {
  39.         warning( "Using obsolete version of blend." );
  40.         $cmd = "blend ";
  41.         $cmd = $cmd + " -ch " + $args[0];
  42.         $cmd = $cmd + " -cfr " + $args[1];
  43.         $cmd = $cmd + " -ad " + $args[2];
  44.         $cmd = $cmd + " -fl " + $args[3];
  45.         $cmd = $cmd + " -fr " + $args[4];
  46.         $cmd = $cmd + " -mk " + $args[5];
  47.         $cmd = $cmd + " -pt " + $args[6];
  48.         $cmd = $cmd + " -tt " + $args[7];
  49.         $cmd = $cmd + " -po " + $args[8];
  50.     }
  51.     else {
  52.         $cmd = "blend2 ";
  53.         $cmd = $cmd + " -ch " + $args[0];
  54.         $cmd = $cmd + " -cfr " + $args[1];
  55.         $cmd = $cmd + " -an " + $args[2];
  56.         $cmd = $cmd + " -fln " + $args[3];
  57.         $cmd = $cmd + " -frn " + $args[4];
  58.         $cmd = $cmd + " -mk " + $args[5];
  59.         $cmd = $cmd + " -pt " + $args[6];
  60.         $cmd = $cmd + " -tt " + $args[7];
  61.         $cmd = $cmd + " -po " + $args[8];
  62.  
  63.         $cmd = $cmd + " -aa " + $args[9];
  64.  
  65.         $cmd = $cmd + " -la " + $args[10];
  66.         $cmd = $cmd + " -ls " + $args[11];
  67.         $cmd = $cmd + " -le " + $args[12];
  68.         $cmd = $cmd + " -rvl " + $args[13];
  69.  
  70.         $cmd = $cmd + " -ra " + $args[14];
  71.         $cmd = $cmd + " -rs " + $args[15];
  72.         $cmd = $cmd + " -re " + $args[16];
  73.         $cmd = $cmd + " -rvr " + $args[17];
  74.     }
  75.  
  76.     return $cmd ;
  77. }
  78.  
  79. global proc doFilletBlendArgList( string $version, string $args[] )
  80.  
  81. //
  82. //    Description :
  83. //        Proc to do one blend depending on number
  84. //        of valid selection items.
  85. //
  86. {
  87.     //---------------------------------------------
  88.     // Get the list of nurbs curves in select list. 
  89.     //---------------------------------------------
  90.     //
  91.     global int $gSelectIsoparmsBit;
  92.     global int $gSelectCurvesOnSurfacesBit;
  93.     global int $gSelectSurfaceEdgeBit;
  94.  
  95.     string $curveList[] = `filterExpand -ex true -sm $gSelectIsoparmsBit -sm $gSelectCurvesOnSurfacesBit -sm $gSelectSurfaceEdgeBit`;
  96.  
  97.     int $curveCount = size($curveList);
  98.     if( $curveCount < 2 ) {
  99.         error( "Must select at least two surface curves to do fillet blend." );
  100.     }
  101.     else {
  102.         string $cmd = pieceTogetherBlendCmd( $version, $args );
  103.         string $results[] = evalEcho( $cmd );
  104.         if( 0 == size($results) ) {
  105.             error( "Fillet blend failed on selected objects." );
  106.         }
  107.         else {
  108.             select -r $results;
  109.         }
  110.     }
  111. }
  112.